def prime(n):
    st = (n + 1) * [True]
    st[0] = st[1] = False
    p = 2

    while p * p <= n:
        if st[p]:
            for i in range(p, n, p):
                st[i] = False
        p += 1

    return [i for i in range(n + 1) if st[i]]

print(prime(100))